package xju.rjxy.shop.common.utils;

import com.alibaba.fastjson.JSON;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

public class JSONUtil {
    public static void printByJSON(HttpServletResponse response, Object obj) {
        response.setContentType("application/json; charset=utf-8");
        try {
            response.getWriter().print(com.alibaba.fastjson.JSON.toJSONString(obj));
        } catch (java.io.IOException e) {
            e.printStackTrace();
        }
    }
}
